#!/bin/bash

function subLastXtext {
    xtext=$(echo "xtext-" | rev)
    replace="[^/]*"$xtext
    by=$(echo $1 | rev)$xtext
    cat locations.properties | head -n 1 | rev | sed "s/${replace}/${by}/" | rev
}

cat <(subLastXtext "umbrella") <(subLastXtext "eclipse") <(subLastXtext "maven") <(cat locations.properties) | cut -d "=" -f2 - | grep "\/"
